# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-dnspython
_pyname=dnspython
pkgver=2.2.1
pkgrel=0
pkgdesc="A DNS toolkit for Python3"
url="https://www.dnspython.org/"
arch="all"
license="ISC"
makedepends="py3-setuptools py3-wheel python3-dev cython"
checkdepends="py3-pytest"
source="https://github.com/rthalley/dnspython/archive/v$pkgver/dnspython-$pkgver.tar.gz
	0001-ignore-setuptools-scm.patch"
builddir="$srcdir/$_pyname-$pkgver"
options="!check" # network tests are failing on CI

replaces="py-dnspython" # Backwards compatibility
provides="py-dnspython=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare

	# set version in setup.cfg
	sed -i "3 a version = $pkgver" setup.cfg
}

build() {
	python3 setup.py build --cython-compile
}

package() {
	python3 setup.py install --cython-compile --prefix=/usr --root="$pkgdir"
}

sha512sums="
ec545468f604d6131f07259ca154c4f71d445d12c336ac1da0d2f025d6478ada76320a7235119312fed85da071ef309d2531e541d3c2340a50deaf3f4dd7b4eb  dnspython-2.2.1.tar.gz
4177952fbce925bd123260738b9768343e11eaaf842638287d357c36bbb11ffc602163a2e10d90752dcc807a0e5d8e5d847dae48a9567da897d38fe81e117584  0001-ignore-setuptools-scm.patch
"
